const db = uniCloud.database();

exports.main = async (event, context) => {
    let {
        optType,
        param
    } = event;
    switch (optType) {
        case "queryAll":
            return queryAllData();
    }

};

async function queryAllData() {
    let res = await db.collection("aiExtra_classify")
        .field({
            name: true,
            _id: true
        })
        .orderBy("sort", "asc").get();
    return res;
};
